# Maintainer: nobody

_realname='libconfini'
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver='1.11.0'
pkgrel=1
pkgdesc='Yet another INI parser (mingw-w64)'
arch=('any')
url='https://madmurphy.github.io/libconfini'
license=('GPL')
options=('staticlibs')
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/madmurphy/${_realname}/archive/${pkgver}.tar.gz")
sha256sums=('ca8bcb288ac5973dd6836c4e9702100781d0f0cdafb79ad170183ecfb56028d7')

prepare() {
	cd "${srcdir}/${_realname}-${pkgver}"
	./bootstrap --noconfigure
}

build() {
	[ -d "${srcdir}/build-${MINGW_CHOST}" ] && rm -rf "${srcdir}/build-${MINGW_CHOST}"
	mkdir -p "${srcdir}/build-${MINGW_CHOST}" && cd "${srcdir}/build-${MINGW_CHOST}"
	../${_realname}-${pkgver}/configure \
		--prefix="${MINGW_PREFIX}" \
		--build="${MINGW_CHOST}" \
		--host="${MINGW_CHOST}" \
		--enable-shared \
		--enable-static
	make
}

package() {
	cd "${srcdir}/build-${MINGW_CHOST}"
	make DESTDIR="${pkgdir}" install
}

